// StatTable.h : StatTable is used to keep a list of information regarding the statements in the program.

#ifndef STAT_TABLE_H
#define STAT_TABLE_H
#include"SPA_Data_Types.h"
#include"AST_XLab2.h"

using namespace std;


class StatTable {
private:
	vector<STATEMENT_INDEX> stmtNo;
	vector<STATEMENT_INDEX> blockEnd;
	vector<STATEMENT_TYPE> stmttype;
	vector<STATEMENT_INDEX> tempStmtNo;
	vector<STATEMENT_INDEX> tempBlockEnd;
	vector<STATEMENT_TYPE> tempStmtType;
	vector<STATEMENT_INDEX> parent;
	vector<STATEMENT_INDEX> tempParent;
	vector<stmtNode*> stmtPointerNode;
	static StatTable *obj;
	bool initialised;
	StatTable();
public:
	static StatTable* getInstance();
	BOOLEAN addEntry(STATEMENT_INDEX n,STATEMENT_TYPE type,STATEMENT_INDEX endOfBlock,STATEMENT_INDEX parentStmt);
	STATEMENT_TYPE getType(STATEMENT_INDEX n);
	STATEMENT_INDEX getBlockEnd(STATEMENT_INDEX n);
	STATEMENT_INDEX getParent(STATEMENT_INDEX n);
	BOOLEAN addStmtNode(stmtNode* node);
	/*int getFollowing(Result&,int , int, int);
	int getFollowingT(Result&, int , int, int);
	int getFollowedby(Result&, int , int, int);
	int getFollowedbyT(Result&,int , int, int);
	int getPar(Result&,int , int, int);
	int getParT(Result&,int , int, int);
	int getChild(Result&,int , int, int);
	int getChildT(Result&,int , int, int);*/
	/*vector<STATEMENT_INDEX> getFollowing(int , int);
	vector<STATEMENT_INDEX> getFollowingT(int , int);
	vector<STATEMENT_INDEX> getFollowedby(int , int);
	vector<STATEMENT_INDEX> getFollowedbyT(int , int);*/
	INTEGER getNoofStat();
	void initialise();

};

#endif